import {all} from 'redux-saga/effects';
import * as types from '../store/action-types';
import helloSaga from './helloSaga';
import watchIncrement from './watchIncrement';
import watchAndLog from './watchAndLog';
import loginSaga from './loginSaga';
import raceSaga from './raceSaga';
import counterSaga from './counterSaga';
export default function* rootSaga(){
    //Promise.all
   yield all([
       helloSaga(),
       watchIncrement(),
       watchAndLog(),
       loginSaga(),
       raceSaga(),
       counterSaga()
   ]);
}

/**
 * saga内置了co库，它会执行完成整个Generator函数
 * let it = helloSaga();
  let result = it.next();
  console.log(1,result);
  if(!result.done){
    result = it.next();
    console.log(1,result);
    if(!result.done){
        result = it.next();
        console.log(1,result);
    }
}
 */

